package org.easy.liblibai.dto.enums;

import lombok.Getter;

@Getter
public enum LibLibAuditStatus {
    WAITING_AUDIT(1, "待审核"),
    AUDITING(2, "审核中"),
    AUDITED_SUCCESS(3, "审核通过"),
    AUDIT_INTERCEPT(4, "审核拦截"),
    AUDIT_FAILURE(5, "审核失败");

    private final int code;
    private final String description;

    LibLibAuditStatus(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static LibLibAuditStatus formCode(int code) {
        for (LibLibAuditStatus status : LibLibAuditStatus.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("No enum constant for code " + code);
    }
}